<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>8.引用类型的垃圾回收原理</title>
</head>

<body>
  <img src="./Xnip2022-07-12_10-52-57.jpg" alt="">
  <script>
      // 引用计数器判断引用数量为0时，系统自动垃圾回收
      let hd ={name: '后盾人'}; // 计数 +1
      let edu = hd; //+1
      let arr = [hd];// +1
      hd = null; // -1
      edu = null; // -1
      arr[0] = null; // -1
      console.log(arr);
  </script>
</body>

</html>